package com.xinbochuang.machine.admin.domain.system;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.xinbochuang.machine.common.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

/**
 * 入库申请备份
 *
 * @author 黄晓鹏
 * @date 2020-09-29
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("SYS_STOREHOUSE_IN_BACKUP")
public class SysStorehouseInBackup extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId("IN_ID")
    private Integer inId;

    /**
     * 部门id
     */
    @TableField("DEPT_ID")
    private Integer deptId;

    /**
     * 部门名称
     */
    @TableField("DEPT_NAME")
    private String deptName;

    /**
     * 入库人id
     */
    @TableField("USER_ID")
    private Integer userId;

    /**
     * 入库人名称
     */
    @TableField("USER_NAME")
    private String userName;

    /**
     * 物品名称
     */
    @TableField("NAME")
    private String name;

    /**
     * 规格型号
     */
    @TableField("MODEL")
    private String model;

    /**
     * 单位id（字典：sys_storehouse_unit）
     */
    @TableField("UNIT_ID")
    private Integer unitId;

    /**
     * 数量
     */
    @TableField("NUM")
    private Integer num;

    /**
     * 生成码
     */
    @TableField("CODE")
    private String code;

    /**
     * 二维码
     */
    @TableField("QR_CODE")
    private String qrCode;

    /**
     * 状态（字典：sys_check_status）
     */
    @TableField("STATUS")
    private String status;

    /**
     * 删除标识
     */
    @TableField("DEL_FLAG")
    private String delFlag;

    /**
     * 入库时间
     */
    @TableField("IN_TIME")
    private String inTime;

    /**
     * 出库时间
     */
    @TableField("OUT_TIME")
    private String outTime;

    /**
     * 库存位置
     */
    @TableField("IN_PLACE")
    private String inPlace;

    /**
     * 出库去向
     */
    @TableField("OUT_PLACE")
    private String outPlace;

    /**
     * 实物是否存在（Y 存在 N 不存在）
     */
    @TableField("IS_EXIST")
    private String isExist;

    /**
     * 单位名称
     */
    @TableField(exist = false)
    private String unitName;

    /**
     * 二级清单列表
     */
    @TableField(exist = false)
    private List<SysStorehouseSecond> children;

    /**
     * 创建人
     */
    @TableField("CREATE_BY")
    private String createBy;

    /**
     * 创建时间
     */
    @TableField("CREATE_TIME")
    private String createTime;

    /**
     * 修改人
     */
    @TableField("UPDATE_BY")
    private String updateBy;

    /**
     * 修改时间
     */
    @TableField("UPDATE_TIME")
    private String updateTime;

    public SysStorehouseInBackup(SysStorehouseIn sysStorehouseIn) {
        this.inId = sysStorehouseIn.getInId();
        this.deptId = sysStorehouseIn.getDeptId();
        this.deptName = sysStorehouseIn.getDeptName();
        this.userId = sysStorehouseIn.getUserId();
        this.userName = sysStorehouseIn.getUserName();
        this.name = sysStorehouseIn.getName();
        this.model = sysStorehouseIn.getModel();
        this.unitId = sysStorehouseIn.getUnitId();
        this.num = sysStorehouseIn.getNum();
        this.code = sysStorehouseIn.getCode();
        this.qrCode = sysStorehouseIn.getQrCode();
        this.status = sysStorehouseIn.getStatus();
        this.delFlag = sysStorehouseIn.getDelFlag();
        this.inTime = sysStorehouseIn.getInTime();
        this.outTime = sysStorehouseIn.getOutTime();
        this.inPlace = sysStorehouseIn.getInPlace();
        this.outPlace = sysStorehouseIn.getOutPlace();
        this.isExist = sysStorehouseIn.getIsExist();
        this.unitName = sysStorehouseIn.getUnitName();
        this.children = sysStorehouseIn.getChildren();
        this.createBy = sysStorehouseIn.getCreateBy();
        this.createTime = sysStorehouseIn.getCreateTime();
        this.updateBy = sysStorehouseIn.getUpdateBy();
        this.updateTime = sysStorehouseIn.getUpdateTime();
    }
}
